package qf.com.controller;

import org.springframework.web.bind.annotation.*;
import qf.com.pojo.Address;

/**
 * @author wbzs,
 * @date 2022/10/19,
 * @time 22:40,
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @RequestMapping("/info/{id}")
    public Address findByid(@PathVariable Integer id) {
        Address address = new Address();
        address.setId(id);
        address.setAddress("北京");
        return address;
    }

    @RequestMapping("/infos")
    public Address findByid( Integer id,  String address) {
        Address addresss = new Address(id, address);
//        address.setId(id);
//        address.setAddress("北京");
        return addresss;


    }



    @RequestMapping("/add")
    public Address findByAddress(@RequestBody Address address){
        Address address1 = new Address();
        address1.setAddress(address.getAddress());
        address1.setId(address.getId());
        return address1;
    }

}
